FROM microsoft/aspnetcore:2.0-nanoserver-1709 AS base
WORKDIR /app
EXPOSE 80

FROM microsoft/aspnetcore-build:2.0-nanoserver-1709 AS build
WORKDIR /src
COPY src/Batman.Gateway/Batman.Gateway.csproj src/Batman.Gateway/
RUN dotnet restore src/Batman.Gateway/Batman.Gateway.csproj
COPY . .
WORKDIR /src/src/Batman.Gateway
RUN dotnet build Batman.Gateway.csproj -c Release -o /app

FROM build AS publish
RUN dotnet publish Batman.Gateway.csproj -c Release -o /app

FROM base AS final
WORKDIR /app
COPY --from=publish /app .
ENTRYPOINT ["dotnet", "Batman.Gateway.dll"]
